Until now, as an electrically erasable non-volatile memory, a NAND flash memory has been in use. With this sort of the NAND flash memory, new data is written as data recorded therein has been erased. The flash memory is provided with an erasure block for batch-wise data erasure, that is erasure of a batch quantity, and, after the recorded data has been erased on the erasure block basis, new data is written in the memory. With the flash memory, the size of the erasure block differs from that of the data write unit (physical sector) such that plural physical sectors are provided in one erasure block.
In the flash memory, data needs to be recorded towards a physically fixed direction in one erasure block. The reason being that, in case data has been recorded in an optional physical sector in the erasure block, the contents of the recorded data are preserved as the sectors lying in a fixed direction from the sector of interest, while the contents of the recorded data are not necessarily kept as for the sectors lying in the opposite direction from the sector of interest. Thus, with the flash memory, the routine practice is to set the physical addresses and the logical addresses in such a manner that, if the data are recorded in a forward direction, the contents of the recorded data are necessarily assured. Meanwhile, the contents of data recorded in an erasure block that are different from the erasure block as a subject of recording are assured at all times without dependency on the data recording position.
As a form of application of this NAND flash memory, there is known a removable small-sized integrated circuit (IC) memory, termed a memory card. The memory card is able to store a large variety of digital data, such as still image data, moving picture data, speech data or music data. For this reason, the memory card is used as an external storage medium in a wide variety of host devices, such as a portable information terminal, a desk top computer, a notebook computer, a mobile phone, an audio device or a household electrical device.
The host device, employing the memory card as an external storage medium, is sometimes provided with an internal storage medium, such as a hard disc. The hard disc is usually accessed with a logical format from the host device, using a file system, called the MS-DOS (trademark), (MICROSOFT Disk Operating System) as a vehicle. For compatibility to such other storage mediums, the common file system, including the MS-DOS, is desirably applicable to the memory card.
The MS-DOS provides for a unit, termed a cluster, as an accessing unit for a storage medium. The MS-DOS generates the FAT (file allocation table), in terms of this cluster, as a unit, to oversee the relationship of interconnections of data recorded in the storage medium. Thus, the host device logically accesses the storage medium, on the cluster basis, to read out data recorded on the storage medium, or to write data on the storage medium.
Meanwhile, in the conventional memory card, the flash memory has a smaller capacity, with the cluster size coinciding with the erasure block size. Thus, as long as data is recorded on the cluster basis, the contents of the recorded data are kept, without dependency on the sort of the recording performed.
However, as the capacity of the flash memory is increased and, in keeping up therewith, the erasure block is increased in size, the cluster size of a memory card employing a flash memory of an increased capacity becomes smaller than the erasure size, if the MS-DOS is used in the file system. When the cluster size is smaller than the erasure block size, and data recording is made on the cluster basis, there is a possibility that the contents of the recorded data may not necessarily be kept.
In order to store the contents of the recorded data, in the memory card employing the flash memory of an increased capacity, the processing for producing a memory area, termed a garbage collection, is carried out, in case the represented cluster is located in rear of the cluster as the subject of writing.
Specifically, the garbage collection in the memory card is carried out as follows:
When data is to be written in a certain cluster in an erasure block, it is verified whether or not there is any recorded valid data in a cluster the address for which is on the rear side of the address of the cluster as a subject of writing in the erasure block. In case the recorded valid data is located in a cluster the address for which is on the rear side with respect to the address of the cluster as the subject of writing in the erasure block, all data in the erasure block, with the exception of the data of the cluster of interest, are temporarily read out to a buffer. A new erasure block is produced and data corresponding to the synthesis of the data in the buffer and the data as the subject of writing is written in the so produced new erasure block.
This processing is the processing of garbage collection performed in the memory card. The garbage collection is routinely executed in the Central Processing Unit (CPU) in the memory card and hence is not recognized by the operating system of the host device.
In this manner, redundant operations, such as data readout and buffering, need to be performed in the garbage collection in the memory card, despite the fact that the processing is carried out at the time of recording. As a consequence, the speed of recording between the host device and the memory card is lowered on the occasion of the occurrence of the garbage collection. It is therefore inherently desirable that data recording may be made at all times without producing garbage collection.
For not producing the garbage collection, it is sufficient if the physical address in the memory is directly supervised from the host side in the course of data writing. However, with the MS-DOS, the medium is not managed by the physical address, so that, for directly accessing the physical addresses in the memory, it is necessary to apply a special file system different from the MS-DOS. This, however, is not desirable because compatibility with other mediums may not be maintained with such special file system.